#ifndef _APP_DELEGATE_H_
#define _APP_DELEGATE_H_

#include <SDL.h>
#include <box2d/box2d.h>

#include "shaderprogram.h"
#include "spriterenderer.h"
#include "gamelevel.h"
#include "player.h"
#include "ballobject.h"
#include "particlegenerator.h"
#include "musicplayer.h"

enum GameState {
    GAME_ACTIVE,
    GAME_MENU,
    GAME_WIN
}; 


class AppDelegate
{
private:
    bool mRunning;
    GameState mState;
    int mWidth;
    int mHeight;
    SDL_Window *mWindow;
    SDL_GLContext mContext;

    b2World mWorld;

    std::vector<GameLevel*> Levels;
    GLuint                 Level;

    Player *player;
    BallObject     *Ball; 
    ParticleGenerator *Particles;
    MusicPlayer *bgm;
    SpriteRenderer  *Renderer;

public:
    AppDelegate();
    ~AppDelegate();

    void OnInitData();

    void update(GLfloat dt);

    void processInput(GLfloat dt);

    void OnEvent(SDL_Event *Event);

    void OnRender();

    void OnCleanup();

    int OnExecute();
};

#endif
